﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XNASpelProjekt
{
    /// <summary>
    /// Base class for Actors affected by gravity 
    /// </summary>
    public abstract class JumpingActor : Actor
    {
        #region Member Variables

        protected int jumpTimeLimit;
        protected int Weight { get; set; }        //ett värde > 0 får ett objekt att falla fortare

        protected int stateTime;            //innehåller tiden som passerat i nuvarande tillstånd
        protected int stateTimeLimit;       //används som gräns för när ett tillstånd uppdateras

        public int Health { get; set; }           //Actorns hälsa

        #endregion

        #region protected methods
        protected virtual void Gravity(Rectangle collision)
        {
        }

        #endregion

        #region constructors
        /// <summary>
        /// Constructor     
        /// </summary>
        /// <param name="texture"></param>
        /// <param name="x">(Optional) The actors x-position</param>
        /// <param name="y">(Optional) The actors y-position</param>
        /// <param name="facing">(Optional) The actors facing</param>
        /// <param name="hidden">(Optional) A hidden actor will not be drawn to screen</param>
        /// <param name="weight">Weight will affect falling speed</param>
        /// <param name="jumpTimeLimit">The time limit for jumping upwards</param>
        protected JumpingActor(Texture2D texture, int x = 0, int y = 0, _Facing facing = _Facing.right, bool hidden = true, int weight = 0, int jumpTimeLimit = 300)
            : base(texture, x, y, facing, hidden)
        {
            this.Weight = weight;
            this.jumpTimeLimit = jumpTimeLimit;
        }

        #endregion
    }
}
